{% if user %}
  {% load static from staticfiles %}
  <head>
  <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.3.min.js"> </script>
  <link media="print, projection, screen" type="text/css" href="{{ STATIC_URL }}themes/blue/style.css" rel="stylesheet">
  <link media="print, projection, screen" type="text/css" href="{{ STATIC_URL }}css/jq.css" rel="stylesheet">
  <script type="text/javascript" src="{{ STATIC_URL }}js/jquery.tablesorter.min.js"> </script>
  </head>
  
	<script type="text/javascript">
    $(document).ready(function()
	{
		$("#reqTable").tablesorter( {sortList: [[0,0], [1,0]]} );
	}
    );
	</script>
  
  MERCHANT PROFILE APPROVAL REQUESTS <br>
  
  <table id="reqApprovalMerchantTable" class="tablesorter">
    <thead> 
    	<tr> 
    		<th>Date</th> 
    		<th>Sender</th> 
    		<th>Status</th>  
    		<th>Comment</th> 
    		<th>Action</th> 
    	</tr> 
    </thead> 
    <tbody>
      {% for profile in merchant_profiles %}
  		<tr>
  			<td>
  				{{profile.0.merchantUser.update_date}}
  			</td>
  			<td>
  			    <a href="/member/profile/approval/view/{{profile.0.id}}/"> {{profile.0.merchantUser.username}} </a>
  			</td>
   			<td>
  				{{profile.1}}
  			</td>
    		<td>
  				{{profile.0.status_comment}}
  			</td>
    		<td>
				<form name="profileApproveHandler" id="profileApproveHandler" method="post" action="/member/profile/approve/{{profile.0.id}}/">
                	<input value="approve" type="submit" id="approve" name="approve">
                   		{% csrf_token %}
                </form>
                <form name="profileRejectHandler" id="profileRejectHandler" method="post" action="/member/profile/reject/{{profile.0.id}}/">
                    <input id="reject_comment" name="reject_comment"/>
                    <label for="reject_comment">rejection comment</label> 
                    <input value="reject" type="submit" id="reject" name="reject">
                   		{% csrf_token %}
                </form>
  			</td>
  		</tr>
  	  {% endfor %}
  	</tbody>
  </table> 
  <br/>
  SHOPPER PROFILE APPROVAL REQUESTS  <br/>
  
  <table id="reqApprovalShopperTable" class="tablesorter">
    <thead> 
    	<tr> 
    		<th>Date</th> 
    		<th>Sender</th> 
    		<th>Status</th>  
    		<th>Comment</th> 
    		<th>Action</th> 
    	</tr> 
    </thead> 
    <tbody>
      {% for profile in shopper_profiles %}
  		<tr>
  			<td>
  				{{profile.0.shopperUser.update_date}}
  			</td>
  			<td>
  			    <a href="/member/profile/approval/view/{{profile.0.id}}/"> {{profile.0.shopperUser.username}} </a>
  			</td>
   			<td>
  				{{profile.1}}
  			</td>
    		<td>
  				{{profile.0.status_comment}}
  			</td>
    		<td>
				<form name="profileApproveHandler" id="profileApproveHandler" method="post" action="/member/profile/approve/{{profile.0.id}}/">
                	<input value="approve" type="submit" id="approve" name="approve">
                   		{% csrf_token %}
                </form>
                <form name="profileRejectHandler" id="profileRejectHandler" method="post" action="/member/profile/reject/{{profile.0.id}}/">
                    <input id="reject_comment" name="reject_comment"/>
                    <label for="reject_comment">rejection comment</label> 
                    <input value="reject" type="submit" id="reject" name="reject">
                   		{% csrf_token %}
                </form>
  			</td>
  		</tr>
  	  {% endfor %}
  	</tbody>
  </table>
{% endif %}